import React from 'react'
import Appson from './appson'
import {useState} from "react"
import Appfn from './appfn'
// 函数组件没有状态和生命周期
function App() {
  let [flag,setFlag] = useState(true)
   let fn = ()=>{
       setFlag(!flag)
   }
  return (
    <div>
        {
            flag ?   <Appfn></Appfn> :""
        }
        <button onClick={fn}>点击我修改flag</button>
    </div>
  )
}

export default App